//一个用数字来存储图片的程序
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

void print_sec(int zu[][30]);
void thranslate(int zu[][30]);
char judge_pic(int n);
void print_secchar(char zu[][30]);
int main(void)
{
	int store_pic[20][30];
	FILE* load;
	errno_t err;
	int crowl = 0, row = 0;
	if ((err = fopen_s(&load, "store.txt", "r")) != 0)
	{
		printf("The store.txt open failed.\n");
		exit(EXIT_FAILURE);
	}
	else
	{
		printf("The store.txt open success!\n");
	}
	int ch;
	for (row = 0; row <= 19; row++)
	{
		for (crowl = 0; crowl <= 29; crowl++)
		{
			ch = getc(load);
			store_pic[row][crowl] = ch-48 ;
			
		}
	}
	print_sec(store_pic);
	thranslate(store_pic);
	return 0;
}
void print_sec(int zu[][30])
{
	int j, i;
	for (j = 0; j <= 19; j++)
	{
		for (i = 0; i <= 29; i++)
			printf("%3d", zu[j][i]);
		printf("\n");
	}
}
void print_secchar(char zu[][30])
{
	int j, i;
	for (j = 0; j <= 19; j++)
	{
		for (i = 0; i <= 29; i++)
			printf("%c", (char)zu[j][i]);
		printf("\n");
	}
}
void thranslate(int zu[][30])
{
	char load_pic[20][30];
	int j, i;
	for (j = 0; j <= 19; j++)
	{
		for (i = 0; i <= 29; i++)
		{
			load_pic[j][i] = judge_pic(zu[j][i]);
		}
	}
	print_secchar(load_pic);
}
char judge_pic(int n)
{
	char ch=' ';
	switch (n)
	{
	case 0:
		ch =' ';
		break;
	case 1:
		ch = '.';
		break;
	case 2:
		ch = '\'';
		break;
	case 3:
		ch = ':';
		break;
	case 4:
		ch = '~';
		break;
	case 5:
		ch = '*';
		break;
	case 6:
		ch = '=';
		break;
	case 7:
		ch = '\'';
		break;
	case 8:
		ch = '%';
		break;
	case 9:
		ch = '#';
		break;
	}
	return ch;
}